package com.xxgc.spring.web;

import com.xxgc.spring.bean.Users;
import com.xxgc.spring.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

//用户请求接口
@WebServlet("/getHello")
public class UserLogin extends HttpServlet {
    //和业务逻辑层搭建关联
    @Autowired
    private ILoginService ils;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ils.userLogin(new Users());
        resp.getWriter().print("Hello Spring123");
    }
}
